#ifndef DATABASE_TIMER_H
#define DATABASE_TIMER_H

#include "log.h"

#include <chrono>

namespace Database
{

namespace Logging
{

using std::chrono::high_resolution_clock;

class Timer
{
public:
    Timer(const string& message, const LogLevel& level = LL_DEBUG);
    Timer(const char * const message, const LogLevel& level = LL_DEBUG);
    virtual ~Timer();

    void stop();

private:
    const string message_;
    const LogLevel logLevel_;
    const high_resolution_clock::time_point start_;
    bool running_;
};

}   // namespace Logging

}   // namespace Database

#endif // DATABASE_TIMER_H
